﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using delegate_tasks_manager.Delegation_WebPart;
namespace delegate_tasks_manager.Delegation_WebPart
{
    [ToolboxItemAttribute(false)]
    public class Delegation_WebPart : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/delegate_tasks_manager/Delegation_WebPart/Delegation_WebPartUserControl.ascx";
        protected override void CreateChildControls()
        {
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
           // if (SPContext.Current.FormContext.FormMode != SPControlMode.Display) 
           // {
           //((Delegation_WebPartUserControl)control).EnableValidators(false);           
           // } 
           // else 
           // { 
           // ((Delegation_WebPartUserControl)control).EnableValidators(true);
           // }
            
        }
    }
}
